﻿<<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>


<%@ Import Namespace="Sis.Web.Reportes" %><%@ Register assembly="Telerik.ReportViewer.WebForms, Version=7.2.13.1016, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" namespace="Telerik.ReportViewer.WebForms" tagprefix="telerik" %><!DOCTYPE html><html><head id="Head1" runat="server"><meta name="viewport" content="width=device-width" /><title>Reporte</title><script src="../../Scripts/jquery-2.1.0.min.js"></script><script src="../../Scripts/bootstrap-datepicker.min.js"></script><script src="../../Scripts/bootstrap.min.js"></script><link href="../../Content/bootstrap.min.css" rel="stylesheet" /><script runat="server">

        void Page_Load(Object sender, EventArgs e)
        {
            CargaData();
        }

        private void CargaData()
        {
            var fechaIni = txtFechaInicio.Text;
            var fechaFin = txtFechaFin.Text;

            Telerik.Reporting.ObjectDataSource objectDataSource1 = new Telerik.Reporting.ObjectDataSource();
            objectDataSource1.DataMember = "GetData";
            objectDataSource1.DataSource = typeof (ReporteVentasByPromotor);
            objectDataSource1.Parameters.Add(new Telerik.Reporting.ObjectDataSourceParameter("Fecha", typeof(DateTime),
                fechaIni));
            objectDataSource1.Parameters.Add(new Telerik.Reporting.ObjectDataSourceParameter("Fecha", typeof(DateTime),
                fechaFin));
            //var rpv = new ReporteVentasByPromotor();
            //rpv.ReportParameters.Add();
        }

        protected void btnGenerar_Click(object sender, EventArgs e)
        {
            CargaData();
        }
</script></head><body><form id="form1" runat="server">
    <div class="container">
        <center><h1>Reporte de Ventas</h1></center>
        <table class="table">
            <tr>
                <td>Fecha Inicio</td>
                <td><asp:TextBox runat="server" CssClass="datepicker" ID="txtFechaInicio"></asp:TextBox></td>
                <td>Fecha Fin</td>
                <td><asp:TextBox runat="server" CssClass="datepicker" ID="txtFechaFin"></asp:TextBox></td>
                <td><asp:Button runat="server" ID="btnGenerar" Text="Generar" CssClass="btn btn-success" OnClick="btnGenerar_Click"/></td>
            </tr>

        </table>
        <a href="VentaRealizada" class="btn btn-danger"><span class="glyphicon glyphicon-backward"> Atras</span></a>
        <hr />
        
      </div>
        <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="517px" ProgressText="Cargando Datos..." Skin="WebBlue" Width="1208px">
<typereportsource typename="Sis.Web.Reportes.ReporteVentasByPromotor, Sis.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"></typereportsource>
</telerik:ReportViewer>
    
    </form>
    <script type="text/javascript">
        // When the document is ready
        $(document).ready(function () {

            $('.datepicker').datepicker({
                format: "dd/mm/yyyy",
                style: "slide"
            });

        });
        </script>
</body>
</html>

        
        
